unit oMarkLabel;

interface

Uses
  Classes, Windows, Controls, Graphics, StdCtrls;

type
  PMarkLabel = ^TMarkLabel;
  TMarkLabel = class
  private
    FCaption: String;
    FRect: TRect;
    FParent: TWinControl;
    FMark: string;
    FPos: Word;
    FNotMark: string;
    FSensitive: Boolean;
    FComponent: Pointer;
    FFindLabel: TObject;
    FColor: TColor;
    procedure SetCaption(const Value: String);
    procedure SetRect(const Value: TRect);
    procedure SetParent(const Value: TWinControl);
    procedure SetMark(const Value: string);
    procedure SetPos(const Value: Word);
    procedure SetNotMark(const Value: string);
    procedure SetSensitive(const Value: Boolean);
    procedure SetComponent(const Value: Pointer);
    procedure SetFindLabel(const Value: TObject);
    procedure SetColor(const Value: TColor);
  public
    property Caption: String read FCaption write SetCaption;
    property Rect: TRect read FRect write SetRect;
    property Parent: TWinControl read FParent write SetParent;
    property Mark: string read FMark write SetMark;
    property PosFind: Word read FPos write SetPos default 0;
    property NotMark: string read FNotMark write SetNotMark;
    property Sensitive: Boolean read FSensitive write SetSensitive default False;
    property Component: Pointer read FComponent write SetComponent;
    property FindLabel: TObject read FFindLabel write SetFindLabel;
    procedure Repaint(const aColor: TColor = clYellow);
    property Color: TColor read FColor write SetColor;
  end;

implementation

Uses
  Forms, SysUtils, oFindLabel;

{ TInfLabel }

procedure TMarkLabel.Repaint(const aColor: TColor = clYellow);
var
  vBakColor: TColor;
begin
  FColor := aColor;
  vBakColor := TFindLabel(FFindLabel).RepaintColor;
  TFindLabel(FFindLabel).RepaintColor := aColor;
  TFindLabel(FFindLabel).MarkLabel1(TLabel(FComponent));
  TFindLabel(FFindLabel).RepaintColor := vBakColor;
end;

procedure TMarkLabel.SetCaption(const Value: String);
begin
  FCaption := Value;
end;

procedure TMarkLabel.SetColor(const Value: TColor);
begin
  FColor := Value;
end;

procedure TMarkLabel.SetComponent(const Value: Pointer);
begin
  FComponent := Value;
end;

procedure TMarkLabel.SetFindLabel(const Value: TObject);
begin
  FFindLabel := Value;
end;

procedure TMarkLabel.SetMark(const Value: string);
begin
  FMark := Value;
end;

procedure TMarkLabel.SetNotMark(const Value: string);
begin
  FNotMark := Value;
end;

procedure TMarkLabel.SetParent(const Value: TWinControl);
begin
  FParent := Value;
end;

procedure TMarkLabel.SetPos(const Value: Word);
begin
  FPos := Value;
end;

procedure TMarkLabel.SetRect(const Value: TRect);
begin
  FRect := Value;
end;

procedure TMarkLabel.SetSensitive(const Value: Boolean);
begin
  FSensitive := Value;
end;

end.
